
const mongoose = require('mongoose');
//连接数据库
mongoose.connect('mongodb://localhost/cxf');

//测试数据连接成功
var db = mongoose.connection;
db.on('error',function(){
	console.log('数据库连接失败')
})
db.once('open',function(){
	console.log('数据库连接成功')
})

module.exports = db;